{% extends "admin/base.html" %}
{% block ext_css %}
    <link href="{{ url_for('static',filename='js/responsive-tables/responsive-tables.css') }}" rel="stylesheet"
          type="text/css">

{% endblock %}
{% block content %}
    <ol class="breadcrumb">
        <li><a href="#">后台</a></li>
        <li class="active">这个菜单</li>
    </ol>
    <hr/>
    <div class="box-header well" data-original-title="">
        <h2><i class="glyphicon glyphicon-leaf red"></i> 这个菜单管理</h2>

        <div class="box-icon">
            <a href="{{ url_for('admin.admin_second_baradd') }}" title="新增菜单" class="btn btn-lg btn-round btn-danger"><i
                    class="glyphicon glyphicon-plus "></i></a>
        </div>
    </div>
    <div class="box-content">
        <table class="table table-striped table-bordered  bootstrap-datatable datatable responsive">
            <thead>
            <tr>
                <th>菜单名称</th>
                <th>菜单链接</th>
                <th>菜单状态</th>
                <th>显示顺序</th>
                <th>显示图标</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {% for b in bar %}
                <tr>
                    <td class="center">{{ b.name }}</td>
                    <td class="center">{{ b.value }}</td>
                    {% if b.is_use == 0 %}
                        <td class="center-text">
                            <span class="label-danger label label-default">停用</span>
                        </td>
                    {% else %}
                        <td class="center-text">
                            <span class="label-success label label-default">在用</span>
                        </td>
                    {% endif %}
                    <td class="center">{{ b.seq }}</td>
                    <td class="center"><i class="{{ b.icon }}"></i></td>
                    <td class="center">
                        <a class="btn btn-info" href="{{ url_for('admin.admin_second_baredit',id=b.id) }}">
                            <i class="glyphicon glyphicon-edit icon-white"></i>
                            编辑
                        </a>
                        <a class="btn btn-danger" data-trigger="confirm"
                           href="{{ url_for('admin.admin_second_baredit',id=b.id) }}">
                            <i class="glyphicon glyphicon-trash icon-white"></i>
                            删除
                        </a>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
{% endblock %}
{% block script %}
    <script type="text/javascript" src="{{ url_for('static', filename='js/jquery/jquery-2.1.1.js') }}"></script>
    <script type="text/javascript"
            src="{{ url_for('static', filename='ext/DataTables-1.10.3/media/js/jquery.dataTables.js') }}"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#user').dataTable({
                stateSave: true
            });
        });
    </script>
{% endblock %}